<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="/tld/authority.tld" prefix="authority" %>
<%@ taglib uri="/tld/token.tld" prefix="token" %>
<%@ taglib uri="/tld/pagination.tld" prefix="page" %>
<%@ taglib uri="/tld/navigator.tld" prefix="navigator"%>

<%--<div class="pageheader">
    <h2>用户信息</h2>

    <div class="breadcrumb-wrapper">
        <span class="left color-999 font13">您当前的位置：</span>
        <ol class="breadcrumb left">
            <li>用户管理</li>
            <li>用户信息</li>
        </ol>
    </div>
</div>--%>
<%--<navigator:navigator url="manager/query.htm"/>--%>

<div class="contentpanel">

    <div class="panel panel-default">
        <form>
            <input type="hidden" name="start" value="${query.start}">
            <input type="hidden" name="length" value="${query.length}">
            <input type="hidden" name="showType" value="${query.showType}">
            <input type="hidden" name="sortField" value="${query.sortField}">
            <input type="hidden" name="sortType" value="${query.sortType}">

            <div class="row">
                <div class="panel-body panel-body2 border-gray-b">
                    <div class="col-md-7" style="width: 250px;">
                        <div class="form-group input-group">
                            <div class="select-container select select-container50 input-group-btn col-dm-3">
                                <select class="select select-offscreen" name="searchKey">
                                    <option value="0" ${query.searchKey == 0 ? 'selected' : ''}>用户名</option>
                                    <option value="1" ${query.searchKey == 1 ? 'selected' : ''}>联系电话</option>
                                </select>
                            </div>
                            <input class="form-control form-control2" type="text" name="searchValue" value="${query.searchValue}" placeholder="请输入查询关键词" />
                        </div>
                    </div>

                    <div class="col-md-6" style="width: 150px;">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态：</label>
                            <div class="col-sm-6">
                                <div class="select-container select select-container50 input-group-btn col-dm-3">
                                    <select class="select select-offscreen" name="disabled">
                                        <option></option>
                                        <option value="0" ${query.disabled == 0 ? 'selected' : ''}>正常</option>
                                        <option value="1" ${query.disabled == 1 ? 'selected' : ''}>锁定</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3">
                        <div class="form-group before-after-none">
                            <label class="col-sm-3 control-label" style="width: 16%;">添加时间：</label>

                            <div class="col-sm-3 dated-time dated-time2" style="width: 38%;padding: 0px;">
                                <div class="select-container select">
                                    <a class="select-choice">
                                        <input type="text" class="input-border-0" name="minCreated"
                                               id="minCreated"
                                               onclick="laydate({elem: '#minCreated'})"
                                               value="<fmt:formatDate value="${query.minCreated}" pattern="yyyy-MM-dd"/>">
                                        <i class="icon icon-riqi" onclick="laydate({elem: '#minCreated'})"></i>
                                    </a>
                                </div>
                            </div>
                            <span class="dated-time-jiange" style="float:left"><b>-</b></span>

                            <div class="col-sm-3 dated-time dated-time2" style="width: 40%;">
                                <div class="select-container select">
                                    <a class="select-choice">
                                        <input type="text" class="input-border-0" name="maxCreated"
                                               id="maxCreated"
                                               onclick="laydate({elem: '#maxCreated'})"
                                               value="<fmt:formatDate value="${query.maxCreated}" pattern="yyyy-MM-dd"/>">
                                        <i class="icon icon-riqi" onclick="laydate({elem: '#maxCreated'})"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                    </div>

                    <div class="btn-group2 left">
                        <button type="submit" class="btn btn-primary btn-4-query"><i class="icon icon-chaxun"></i>查询</button>
                    </div>
                </div>
            </div>

            <%--<div class="row pt15 condition-4-query" style="display: ${query.showType == 0 ? 'none;' : 'block;'}">
                <div class="panel-body">

                </div>
            </div>--%>
        </form>
        <%--<div class="row">
            <div class="shrink ${query.showType == 0 ? '': 'active'}">
                <button type="button" class="shrink-btn btn-default btn-4-toggle">
                    <i class="icon icon-xiala1"></i>
                    <span>${query.showType == 0 ? '展开查询条件': '收起查询条件'}</span>
                </button>
            </div>
        </div>--%>
    </div>

    <div class="panel panel-default">
        <div class="row">
            <div class="panel-body panel-body2 plr20">
                <div class="left">
                    <div class="btn-group left btn-group-none2">
                        <%--<authority:authority url="/manager/add">--%>
                            <button class="btn btn-primary btn-4-add"><i class="icon icon-tianjia"></i>新增</button>
                        <%--</authority:authority>--%>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class=" plr20">
                <div class="table-responsive">
                    <table class="table dataTable">
                        <tbody>
                        <tr>
                            <th style="width: 50px"></th>
                            <th style="width: 160px;"><strong>用户名</strong></th>
                            <th style="width: 160px;"><strong>联系电话</strong></th>
                            <th style="width: 100px;"><strong>状态</strong></th>
                            <th style="width: 300px;"><strong>所属部门</strong></th>
                            <th style="width: 160px;"><strong>拥有角色</strong></th>
                            <th style="width: 160px;"><strong>添加时间</strong></th>
                            <th style="width: 200px;"><strong>操作</strong></th>
                        </tr>
                        <c:forEach items="${paging.items}" var="item" varStatus="status">
                            <tr>
                                <td>${(paging.pageIndex - 1) * paging.pageSize + (status.index + 1)}</td>
                                <td>${item.name}</td>
                                <td>${item.mobile}</td>
                                <td>
                                        ${item.disabled ? '<font style="color:red">锁定</font>' : '<font style="color:green">正常</font>'}
                                </td>
                                <td>${item.departments}</td>
                                <td>${item.roles}</td>
                                <td>
                                    <fmt:formatDate value="${item.created}" pattern="yyyy-MM-dd HH:mm:ss"/>
                                </td>
                                <td>
                                    <%--<authority:authority url="/manager/modify">--%>
                                        <a class="btn-4-modify" data-id="${item.id}">修改</a>
                                    <%--</authority:authority>--%>
                                    <%--<authority:authority url="/manager/resetPassword">--%>
                                        <a class="btn-4-reset-password margin-l-10" data-id="${item.id}">重置密码</a>
                                    <%--</authority:authority>--%>
                                    <c:choose>
                                        <c:when test="${item.disabled}">
                                            <%--<authority:authority url="/manager/enable">--%>
                                                <a class="btn-4-enable margin-l-10" data-id="${item.id}">解锁</a>
                                            <%--</authority:authority>--%>
                                        </c:when>
                                        <c:otherwise>
                                            <%--<authority:authority url="/manager/disable">--%>
                                                <a class="btn-4-disable margin-l-10" data-id="${item.id}">锁定</a>
                                            <%--</authority:authority>--%>
                                        </c:otherwise>
                                    </c:choose>
                                    <%--<authority:authority url="/manager/delete">--%>
                                        <a class="btn-4-delete margin-l-10" data-id="${item.id}">删除</a>
                                    <%--</authority:authority>--%>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                <page:page pageIndex="${paging.pageIndex}" pageSize="${paging.pageSize}" count="${paging.count}"/>
            </div>
        </div>
    </div>
    <script src="js/system/manager-List.js"></script>
</div>
